package cc.orange.mainView;

import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.RelativeLayout;

//import com.tendcloud.tenddata.TalkingDataSDK;
import com.xcheng.retrofit.Call;
import com.xcheng.retrofit.DefaultCallback;
import com.xcheng.retrofit.HttpError;
import com.xcheng.retrofit.RetrofitFactory;

import org.greenrobot.eventbus.EventBus;

import java.util.ArrayList;
import java.util.List;

import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.LinearLayoutManager;
import cc.orange.R;
import cc.orange.adapter.MsgCon4KFAdapter;
import cc.orange.base.BaseActivity;
import cc.orange.databinding.ActivityConvekfBinding;
import cc.orange.entity.BaseEntity;
import cc.orange.entity.IsLoginsEntity;
import cc.orange.entity.KFChatListEntity;
import cc.orange.http.ApiService;
import cc.orange.utils.ScreenUtils;
import cc.orange.utils.SoftKeyBoardListener;
import cc.orange.utils.ZXToastUtil;
import cc.orange.utils.emojis.EmoticonBoard;
import cc.orange.utils.emojis.RongUtils;
import okhttp3.MediaType;
import okhttp3.RequestBody;

public class ConverNotesFActivity extends BaseActivity implements View.OnClickListener{

    private ActivityConvekfBinding binding;
    private String uid;

    private MsgCon4KFAdapter adapter;
    private List<KFChatListEntity.Data> list = new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
        binding = DataBindingUtil.setContentView(this, R.layout.activity_convekf);
        initViews();
        binding.converListTitle1.setText("重要通知");
    }


    private void initViews() {
        RelativeLayout.LayoutParams pp = new RelativeLayout.
                LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ScreenUtils.getStatusBarHeight(ConverNotesFActivity.this));
        binding.talktabTop.setLayoutParams(pp);

        binding.msginfoBack.setOnClickListener(this);

        KFChatListEntity.Data dd = new KFChatListEntity.Data();
        list.add(dd);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
//        linearLayoutManager.setStackFromEnd(true);
        binding.talkMsgList.setLayoutManager(linearLayoutManager);
        adapter = new MsgCon4KFAdapter(list,3);
        binding.talkMsgList.setAdapter(adapter);

        binding.talkEdits2.setVisibility(View.GONE);
    }


    @Override
    protected void onPause() {
        super.onPause();
//        EventBus.getDefault().post(new IsLoginsEntity(true));
//        TalkingDataSDK.onPageEnd(this, getLocalClassName());
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){

            case R.id.msginfo_back:
                finish();
                break;
        }
    }



    @Override
    protected void onResume() {
        super.onResume();
//        TalkingDataSDK.onPageBegin(this, getLocalClassName());
    }
}